package com.earthea.scaffold;

import cn.hutool.system.SystemUtil;
import org.apache.commons.io.FileUtils;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ImportResource;

import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

/**
 * 启动程序
 */
@MapperScan({"com.earthea.scaffold.mapper"})
@ImportResource("classpath*:spring/*.xml")
@SpringBootApplication(scanBasePackages = {"com.earthea.scaffold"})
public class Application {

    public static void main(String[] args) throws IOException {
        SpringApplication.run(Application.class, args);
        FileUtils.write(new File("java.pid"), String.valueOf(SystemUtil.getCurrentPID()), StandardCharsets.UTF_8);
        System.out.println("(♥◠‿◠)ﾉﾞ  程序启动成功   ლ(´ڡ`ლ)ﾞ");
    }
}
